< previous page page_484 next page >

Page 484
e10a6a0a59f035e870d90cca05b85fce.gif
' Bound the X values.
Xmin = Points(1, 1).trans(1)
Xmax = Xmin
For i = 1 To NumX
    For j = 1 To NumZ
        ix = CInt(Points(i, j).trans(1))
        If Xmin > ix Then Xmin = ix 
        If Xmax < ix Then Xmax = ix 
    Next j
Next i

' Create the hi and lo arrays.
ReDim lo(Xmin To Xmax)
ReDim hi(Xmin To Xmax)

' Draw the X and Z front edges.
For i = 2 To NumX
    ' Draw the edge between
    ' Points(i - 1, NumZ) and Points(i, NumZ)
    ' and set hi and lo for its values.
    DrawAndSetLine pic, _
        Points(i - 1, NumZ).trans(1), _
        Points(i - 1, NumZ).trans(2), _
        Points(i, NumZ).trans(1), _
        Points(i, NumZ).trans(2), _
        hi, lo
Next i
For i = 2 To NumZ
    ' Draw the edge between
    ' Points(NumX, i - 1) and Points(NumX, i)
    ' and set hi and lo for its values.
    DrawAndSetLine pic, _
        Points(NumX, i - 1).trans(1), _
        Points(NumX, i - 1).trans(2), _
        Points(NumX, i).trans(1), _
        Points(NumX, i).trans(2), _
        hi, lo
Next i

' Draw the "rectangles."
For i = NumX - 1 To 1 Step -1
       For j = NumZ - 1 To 1 Step -1
           ' Draw the edges between:
           '   Points(i, j) and Points(i + 1, j)
           '   Points(i, j) and Points(i, j + 1)

           ' If the right side of the "rectangle"
           ' leans over the top like this:
           '    +_
           '    | \_
           '    | \_

 
< previous page page_484 next page >